package com.example.mvvm.pokemon.ui

import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import com.example.mvvm.pokemon.ui.list.ListViewModel

object ViewModelFactory : ViewModelProvider.NewInstanceFactory() {

    override fun <T : ViewModel?> create(modelClass: Class<T>): T {
        if (ListViewModel::class.java.isAssignableFrom(modelClass)) {
            return ListViewModel() as T
        }
        return super.create(modelClass)
    }
}